//
//  NewTuoKeInfoViewController.m
//  wangzhe
//
//  Created by 李 佳伟 on 2018/3/8.
//  Copyright © 2018年 李 佳伟. All rights reserved.
//

#import "NewTuoKeInfoViewController.h"
#import "JTCSM.h"
#import "MyInfoView.h"
static CGFloat myinfoHeight = 50;
@interface NewTuoKeInfoViewController ()
{
    UIImageView *headerImageView;
}
@property (nonatomic,strong) UIImageView *logoImageV;
@property (nonatomic,strong) UILabel *nameLabel;
@property (nonatomic,strong) UILabel *phoneLabel;
@end

@implementation NewTuoKeInfoViewController

- (void)gotBack{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [df isRemoveTarbar:YES];
    self.navigationController.navigationBar.hidden = YES;
    self.view.backgroundColor = [UIColor whiteColor];
    
    
    headerImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, KCONTROLLERWith, KCONTROLLERWith*0.6427)];
    headerImageView.image = [UIImage imageNamed:@"拓客详情_背景.png"];
    [self.view addSubview:headerImageView];
    UIImage * firstImage = [UIImage imageNamed:@"fanhui.png"];
    CGRect firstFrame = CGRectMake(20, 20, 50, 44);
    CGFloat width = firstFrame.size.width;
    CGFloat height = firstFrame.size.height;
    CGFloat imagesize = 20;
    UIButton * leftButton = [[UIButton alloc]initWithFrame:firstFrame];
    [leftButton setImage:firstImage forState:UIControlStateNormal];
    [leftButton addTarget:self action:@selector(gotBack) forControlEvents:UIControlEventTouchUpInside];
    leftButton.imageEdgeInsets = UIEdgeInsetsMake((height-imagesize)/2, 0, (height-imagesize)/2, (width-imagesize));
    [self.view addSubview:leftButton];
    
    CGFloat logoimagesize = 80;
    self.logoImageV = [[UIImageView alloc]initWithFrame:CGRectMake((KCONTROLLERWith-logoimagesize)/2, CGRectGetHeight(headerImageView.frame)/2-logoimagesize/2, logoimagesize, logoimagesize)];
    self.logoImageV.image = [UIImage imageNamed:@"拓客列表_头像.png"];
    [headerImageView addSubview:self.logoImageV];
    
    self.nameLabel = [UILabel initWithFrame:CGRectMake(0, KVIEW_Y(self.logoImageV)+30*[JTCSMSingle shareSingle].adaptationNumber, KCONTROLLERWith, 20) text:@"永辉超市" font:16 textAlignment:NSTextAlignmentCenter texcolor:RGBACOLOR(51, 51, 51, 1) backgroundColor:nil];
    [headerImageView addSubview:self.nameLabel];
    
    self.phoneLabel = [UILabel initWithFrame:CGRectMake(0, KVIEW_Y(self.nameLabel)+5, KCONTROLLERWith, 20) text:@"133****0395" font:14 textAlignment:NSTextAlignmentCenter texcolor:RGBACOLOR(153, 153, 153, 1) backgroundColor:nil];
    [headerImageView addSubview:self.phoneLabel];
    
    [self layoutMyinfoView];
    
}


- (void)layoutMyinfoView{
    
    NSArray *array = @[@"累计收益（元）",@"拓客数量（个）"];
    NSArray *contentarray = @[@"12234.00",@"8）"];
    NSArray *iamgearray = @[@"拓客详情_累计.png",@"拓客详情_拓客数量.png"];
    NSArray *array1 = @[@"用户状态",@"商家认证",@"入住日期"];
    NSArray *contentarray1 = @[@"审核通过",@"未认证",@"2018-04-10"];
    NSArray *imagearray1 = @[@"拓客详情_用户状态.png",@"拓客详情_商家认证.png",@"拓客详情_入驻日期.png"];
    NSArray *array2 = @[@"设置商户备注和标签"];
    NSArray *contentarray2 = @[@"iPhone X"];
    for (int i = 0; i < array.count; i++) {
        MyInfoView *view1 = [[MyInfoView alloc]initWithFrame:CGRectMake(0, KVIEW_Y(headerImageView)+myinfoHeight*i, KCONTROLLERWith, myinfoHeight) imagename:iamgearray[i] title:array[i]placeholder:nil isShowLabel:labelType radioBtnIndex:0 GroupId:@""];
        view1.tag = 100+i;
        view1.userInteractionEnabled = YES;
        view1.footerLabel.text = contentarray[i];
        view1.footerLabel.textColor = [df colorWithHexString:@"666666" alpha:1];
        [self.view addSubview:view1];
    }
    [df lineViewWithHeightofTop:KVIEW_Y(headerImageView)+myinfoHeight*array.count+10 superView:self.view spacing:0 color:RGBACOLOR(241, 241, 241, 1) lineHeight:10];
    for (int i = 0; i < array1.count; i++) {
        MyInfoView *view2 = [[MyInfoView alloc]initWithFrame:CGRectMake(0, KVIEW_Y(headerImageView)+myinfoHeight*array.count+10+myinfoHeight*i, KCONTROLLERWith, myinfoHeight) imagename:imagearray1[i] title:array1[i]placeholder:nil isShowLabel:labelType radioBtnIndex:0 GroupId:@""];
        view2.tag = 102+i;
        view2.userInteractionEnabled = YES;
        view2.footerLabel.text = contentarray1[i];
        view2.footerLabel.textColor = [df colorWithHexString:@"999999" alpha:1];
        if (i == 0) {
            view2.footerLabel.textColor = [df colorWithHexString:@"10a158" alpha:1];
        }
        [self.view addSubview:view2];
    }
    [df lineViewWithHeightofTop:KVIEW_Y(headerImageView)+myinfoHeight*(array.count+array1.count)+20 superView:self.view spacing:0 color:RGBACOLOR(241, 241, 241, 1) lineHeight:10];
    for (int i = 0; i < array2.count; i++) {
        MyInfoView *view3 = [[MyInfoView alloc]initWithFrame:CGRectMake(0, KVIEW_Y(headerImageView)+myinfoHeight*(array.count+array1.count)+20+myinfoHeight*i, KCONTROLLERWith, myinfoHeight) imagename:nil title:array2[i]placeholder:nil isShowLabel:ImageandlabelViewType radioBtnIndex:0 GroupId:@""];
        view3.tag = 108+i;
        view3.userInteractionEnabled = YES;
        view3.footerLabel.text = contentarray2[i];
        view3.footerLabel.textColor = [df colorWithHexString:@"666666" alpha:1];
        [self.view addSubview:view3];
    }
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
